package cn.kust.serviceinterestpoint.controller;


import cn.kust.microtourismcommon.pojo.dto.ResponseResult;
import cn.kust.serviceinterestpoint.service.InterestInterestCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author microTourism
 * @since 2022-07-28
 */
@RestController
@RequestMapping("/serviceinterestpoint/interest-interest-category")
@Api(tags = "兴趣点-分类标签关联模块")
public class InterestInterestCategoryController {
    @Autowired
    InterestInterestCategoryService interestCategoryService;

    @ApiOperation(value="绑定兴趣点-分类标签之间的关联")
    @PostMapping("/save")
    @ApiImplicitParams({
            @ApiImplicitParam(value="兴趣点id",name="interestId", example = "1"),
            @ApiImplicitParam(value="分类标签ids,数组",name="categoryIds",
                    allowMultiple = true,dataType = "Array", example = "1,2,3")
    })
    /**
     * 添加绑定兴趣点的所有分类标签
     */
    public ResponseResult addCategoryInterest(Long interestId, Long[] categoryIds){
        interestCategoryService.addInterestCategorys(interestId,categoryIds);
        return ResponseResult.success("绑定兴趣点-分类标签之间的关联成功");
    }
}

